<#include "/common/headAdmin.ftl">
<@head>
    <div class="container">
<!--
${pages!}
-->
    </div> <!-- /container -->
   <div class="container">



<div class="panel panel-default">
  <!-- Default panel contents -->
  <div class="panel-heading">提现列表</div>
  <div class="panel-body">
    <p>.提现列表..</p>
  </div>

  <!-- Table -->
  <table class="table">
<tr>
<th>ID</th>
<th>UID</th>
<th>账号</th>
<th>MONEY</th>
<th>状态</th>
<th>创建时间</th>
<th>审批时间</th>
<th>说明</th>
<th>操作</th>
</tr>
 <#list pages.list as data>
 <tr>
 <td>${data.id}</td>
 <td>${data.uid}</td>
  <td>${getUserName(data.uid)}</td>
 <td>￥${data.totleMoney}</td>
 <td><#if data.status==0>处理中<#elseif  data.status==1>完成<#else>失败</#if></td>
 <td>${data.createTime?datetime}</td>
 <td>${(data.updateTime?datetime)!}</td>
 <td>${data.remark}</td>
 <td>

<#if data.status == 0>
  <button type="button" class="btn btn-default recharge1"  data="${data.id}">同意</button>
  <button type="button" class="btn btn-default recharge2 btn-danger"   data="${data.id}">取消</button>
  </#if>
 </td>
 </tr>
 </#list>

  </table>
</div>


<@page "searchWithdraw" pages/>

</div> <!-- /container -->



<@js>
//-------

$(".recharge1").click(function(){
    var id=$(this).attr("data");
    $.post("/admin/money/moneyStatus", {"type":"withdraw_apply","id":id,status:"yes",remark:"审批完成"},
              function(data){
                 console.log(data); //  2pm
                alert(data.status+data.message);
                 if(data.status==200){
                    window.location.href=window.location.href;
                 }
             }, "json");

});


$(".recharge2").click(function(){
    var id=$(this).attr("data");
    var remark=prompt("失败原因","流水不足!")
      if (remark!=null && remark!=""){
        $.post("/admin/money/moneyStatus", {"type":"withdraw_apply","id":id,status:"no",remark:remark},
              function(data){
                console.log(data); //  2pm
                alert(data.status+data.message);
                 if(data.status==200){
                    window.location.href=window.location.href;
                 }
             }, "json");

    }else{return ;}
});



</@js>

</@head>






